package com.azdebugit.jvm.cass.loader;

public class TestJvm {
    public static void main(String[] args) {
        //1、获取当前类的ClassLoader
        BootstrapClassLoaderTest classLoaderTest = new BootstrapClassLoaderTest();
        ClassLoader classLoader = classLoaderTest.getClass().getClassLoader();
        System.out.println(classLoader);
        //2、获取当前线程上下文的ClassLoader
        new Thread(){
            @Override
            public void run() {
                System.out.println(Thread.currentThread());
                ClassLoader classLoader1 = Thread.currentThread().getContextClassLoader();
                System.out.println(classLoader1);
                System.out.println(classLoader);
            }
        }.run();
        //3、获取系统的ClassLoader
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);

    }

}
